import { DeliverType } from '@/store/modules/order/types/order'

export interface OrderDetail {
    expressCompany: {
        expressCompanyCode: string
        expressCompanyName: string
        expressNo: string
    } | null
    deliverType: keyof typeof DeliverType
    dropDeliver: boolean
    items: Item[]
    receiver: {
        address: string
        mobile: string
        name: string
    }
    sender: {
        address: string
        mobile: string
        name: string
    }
    cargo: string
}

export enum DISTRIBUTION {
    MERCHANT = 'MERCHANT',
    EXPRESS = 'EXPRESS', //快递配送
    INTRA_CITY_DISTRIBUTION = 'INTRA_CITY_DISTRIBUTION', //同城配送
    SHOP_STORE = 'SHOP_STORE', //店铺门店
    VIRTUAL = 'VIRTUAL', // 无需物流
}
export interface IOrder {
    orderNo: string
    shopOrderNo: string
    distributionMode: keyof typeof DISTRIBUTION
    platform: string
}
export interface ShopOrderItems {
    productName: string
    image: string
    specs: string
    num: number
    dealPrice: number
    id: ''
}
interface Item {
    itemId: string
    num: number
}
export interface ILogistics {
    value: { address?: string; mobile?: string; name: string; code?: string }
    text: string
}
export interface OrderDetailProps {
    id: string
    createTime: string
    updateTime: string
    buyerId: string
    buyerNickname: string
    no: string
    status: string
    type: string
    timeout: {
        payTimeout: string
        confirmTimeout: string
        commentTimeout: string
        afsAuditTimeout: string
    }
    orderPayment: {
        id: string
        createTime: string
        sn: string
        payerId: string
        type: string
        totalAmount: string
        freightAmount: string
        discountAmount: string
        payAmount: string
        payTime: string
    }
    orderDiscounts: any[]
    shopOrders: {
        id: string
        createTime: string
        updateTime: string
        no: string
        status: string
        shopId: string
        shopName: string
        shopLogo: string
        totalAmount: string
        freightAmount: string
        discountAmount: string
        remark: string
        shopOrderItems: {
            id: string
            updateTime: string
            status: string
            afsStatus: string
            shopId: string
            productId: string
            productName: string
            services: any[]
            packageId: string
            packageStatus: string
            skuId: string
            num: number
            image: string
            weight: number
            freightTemplateId: string
            freightPrice: string
            salePrice: string
            dealPrice: string
            fixPrice: string
            specs: string[]
        }[]
    }[]
    orderReceiver: {
        id: string
        name: string
        mobile: string
        areaCode: string[]
        address: string
    }
    shopOrderPackages: {
        id: string
        createTime: string
        updateTime: string
        version: number
        deleted: boolean
        shopId: string
        orderNo: string
        status: string
        type: string
        expressCompanyName: string
        expressCompanyCode: string
        expressNo: string
        receiverName: string
        receiverMobile: string
        receiverAddress: string
        deliveryTime: string
        remark: string
    }[]
}
export interface LogisticsType {
    // address: '321321'
    // cityCode: '130200'
    // contactName: '321321'
    // contactPhone: '13111111111'
    // createTime: '2023-01-13 17:37:11'
    // defReceive: 'NO'
    // defSend: 'YES'
    // deleted: false
    // id: '1613832519020273664'
    // provinceCode: '130000'
    // regionCode: '130202'
    // shopId: '1613792222109024256'
    // updateTime: '2023-01-13 17:37:11'
    // version: 0
    // zipCode: '342134'
    address: string
    cityCode: string
    contactName: string
    contactPhone: string
    createTime: string
    defReceive: string
    defSend: string
    deleted: boolean
    id: string
    provinceCode: string
    regionCode: string
    shopId: string
    updateTime: string
    version: number
    zipCode: string
}
